import Vue from 'vue'
import App from '@/App.vue'
import store from './store';
import router from './router'
import '@/mock/mock.js'
import '@/utils/eventBus'
import './elementUI/index'
import showMessage from '@/utils/showMessage'
import './style/resent.less'
Vue.prototype.$showMessage = showMessage;
import wxApi from './api/getwx.js'
wxApi({state:'0',count:'6',city:'哈尔滨'}).then(
    (res)=>{
        console.log(res);
    }
).catch((err)=>{
    console.log(err);
})


store.dispatch("leftAside/getLeftAside");


//自定义loading指令
import loading from '@/utils/loading'
// 定义指令
Vue.directive('loading', loading);
// 定义懒加载指令
import lazying from '@/utils/lazying'
Vue.directive('lazying', lazying);

Vue.directive('documentClick', {
    bind(el, binding, vnode) {
        document.addEventListener('click', binding.value, false)

    },
    inserted(el, binding, vnode) { },
    update(el, binding, vnode, oldVnode) { },
    componentUpdated(el, binding, vnode) { },
    unbind(el, binding, vnode) { },
});


new Vue({
    store,
    router,
    render: h => h(App),
}).$mount('#app')
function unique(arr){
    var array=[];
    for (let i= 0; index < array.length; i++) {
        if(array.indexOf(arr[i])===-1){
            array.push(arr[i])
        }
    }
    return array;
}





